package bishi.day26_5_24;

/**
 * @author 是阿秋啊
 * @date 2022/05/24 13:12
 **/
public class Solution {
    public int jumpFloorII(int number){
        // write code here
        if (number == 1) return 1;
        if (number == 2) return 2;
        int[] arr = new int[number+1];
        arr[0] = 1;
        arr[1] = 1;
        arr[2] = 2;
        for (int i = 3; i < arr.length; i++) {
            int j = i - 1;
            while (j >= 0) {
                arr[i]+=arr[j];
                j--;
            }
        }
        return arr[number];
    }
}